<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<script>
$(function(){
	$("#dealerLeverSelect").val('${dealerLever.level }');
	$("#priceClassId").val("${dealerLever.priceClass.id}");
	$("select[name='dealerLever.type']").val("${dealerLever.type}");
});



</script>

<div class="pageContent">
	<form method="post" action="${rootUrl}/member/dealer-level/${dealerLever.id}" class="pageForm required-validate" onsubmit="return validateCallback(this, editDialogAjaxDone);">
		<c:if test="${dealerLever.id != 0 && dealerLever.id != '' }"><input type="hidden" name="_method" value="put"></c:if>
		<div class="pageFormContent" layoutH="56">
			<p>
				<label>等级名称：</label>
				<input name="dealerLever.name" class="required" type="text" size="30" value="${dealerLever.name }"/>
			</p>

			<p>
				<label>等级高低：</label>
				<select id="dealerLeverSelect" name="dealerLever.level" value="${dealerLever.level }">
				<option value="1">1</option>
				<option value="2">2</option>
				<option value="3">3</option>
				<option value="4">4</option>
				<option value="5">5</option>
				<option value="6">6</option>
				<option value="7">7</option>
				<option value="8">8</option>
				<option value="9">9</option>
				<option value="10">10</option>
				</select>
			</p>
			<p>
				<label>分佣等级(%)：</label>
				<input name="dealerLever.percent" class="required" type="text" size="30" value="${dealerLever.percent }"/>(%)
			</p>
			<p>
				<label>加盟积分：</label>
				<input name="dealerLever.joinPoint" class="required" type="text" size="30" value="${dealerLever.joinPoint }"/>
			</p>
			<p>
				<label>加盟费用(元)：</label>
				<input name="theJoinMoney" class="required" type="text" size="30" value="<fmt:formatNumber value="${dealerLever.joinMoney/100}" pattern="0.00"/>"/>
			</p>
			<p>
				<label>商品价格：</label>
				<select name="priceClassId" id="priceClassId">
					<c:forEach items="${priceClassList }" var="priceClass">
					<option value="${priceClass.id }">${priceClass.name }</option>
					</c:forEach>
				</select>
			</p>
			
			<p>
				<label>类型：</label>
				<select name="dealerLever.type">
					<option value="0">基础会员</option>
					<option value="1">分销商</option>
					<option value="2">代理</option>
				</select>
			</p>

			<div style="display: none">
				<script id="dealerLeverEditorImageId" type="text/plain"></script>
			</div>
				<label>	等级图标:</label>
				<input type="hidden" id="dealerLeverI_textImgUrlId" name="dealerLever.imgUrl" />
				<div class="imgContainer">
				<a href="#" onclick="iFileUploader.upImg();" id="myEditorImagesss">
				<img id="dealerLeverI_ShowImgUrlId" src="${dealerLever.imgUrl }" /></a></div>
				


		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>


<script>
iFileUploader.initImg("dealerLeverEditorImageId","dealerLeverI_textImgUrlId","dealerLeverI_ShowImgUrlId",{imageFolder:3});
</script>